package org.book.service;

import java.util.List;

import org.book.dao.BorrowBean;
import org.book.dao.BorrowDao;
import org.book.dao.BorrowDaoImp;


public class BorrowService {
	BorrowDao dao = new BorrowDaoImp();
	public List<BorrowBean> getList(int pageCurrent, int pageSize) {
		return dao.getList(pageCurrent, pageSize);
	}
	public List<BorrowBean> getList(int pageCurrent, int pageSize, int user_id) {
		return dao.getList(pageCurrent, pageSize, user_id);
	}
	public int getCount() {
		return dao.getCount();
	}
	public int getCount(int user_id) {
		return dao.getCount(user_id);
	}
	
	public boolean remove(int no) {
		if(dao.isEmpty(no)) {
			return dao.remove(no);
		}
		return false;
	}
	
	public boolean update(int no,BorrowBean stu) {
		if(dao.isEmpty(no)) {
			return dao.update(no, stu);
		}
		return false;
	}
	
	//仅修改归还时间
	public boolean update(int id) {
		if(dao.isEmpty(id)) {
			return dao.update(id);
		}
		return false;
	}
	
	public boolean add(BorrowBean stu,int book_id, int user_id) {
		return dao.add(stu, book_id, user_id);
	}
	
	
	public BorrowBean getStuByNo(int no) {
		if(dao.isEmpty(no)) {
			return dao.getStuByNo(no);
		}
		return null;
	}
	
	public List<BorrowBean> getLike(String str){
		return dao.getLike(str);
	}
	
	public List<BorrowBean> getLike(String str, int user_id){
		return dao.getLike(str,user_id);
	}
}
